load("//tools:defaults.bzl", "ts_devserver", "ts_library")
load("//dev-infra/benchmark/component_benchmark:benchmark_test.bzl", "benchmark_test")
load("//modules/benchmarks:e2e_test.bzl", "e2e_test")

package(default_visibility = ["//modules/benchmarks:__subpackages__"])

ts_library(
    name = "ng1",
    srcs = glob(["*.ts"]),
    tsconfig = "//modules/benchmarks:tsconfig-build.json",
    deps = [
        "//modules/benchmarks/src:util_lib",
        "//modules/benchmarks/src/tree:util_lib",
    ],
)

ts_devserver(
    name = "devserver",
    bootstrap = ["@npm//:node_modules/angular/angular.js"],
    entry_module = "angular/modules/benchmarks/src/tree/ng1/index",
    port = 4200,
    static_files = ["index.html"],
    deps = [":ng1"],
)

benchmark_test(
    name = "perf",
    server = ":devserver",
    deps = [
        "//modules/benchmarks/src/tree:detect_changes_perf_tests_lib",
        "//modules/benchmarks/src/tree:perf_tests_lib",
    ],
)

e2e_test(
    name = "e2e",
    server = ":devserver",
    deps = [
        "//modules/benchmarks/src/tree:detect_changes_e2e_tests_lib",
        "//modules/benchmarks/src/tree:e2e_tests_lib",
    ],
)
